package com.sixth.health.controller;

import com.sixth.core.entity.TestDetail;
import com.sixth.health.servict.TestResultService;
import com.sixth.health.vo.TestResultVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/health/testResult")
public class TestResultController {
    @Autowired
    private TestResultService testResultService;
    @ApiOperation(value = "app健康测试结果", notes = "根据传入的 List<TestDetail> testDetails 来获取测试结果")
    @PostMapping("/getList")
    public TestResultVo getTestResult(@RequestBody List<TestDetail> testDetails) {
        return testResultService.getTestResult(testDetails);
    }

    @ApiOperation(value = "app健康测试结果", notes = "根据传入的 List<TestDetail> testDetails 来获取测试结果")
    @PostMapping("/getList2")
    public TestResultVo resultVo(@RequestBody List<TestDetail> testDetails) {
        return testResultService.getTestResult02(testDetails);
    }
}
